<template>
   
 <img src="../img/1.png" alt="" width="100%">
<h2>找电影</h2>

<van-card
v-for="item in data"
  num="2"
  price="2.00"
  :desc="item.person"
  :title="item.name"
  :thumb="item.url"
  @click="toget(item)"
/>

</template>

<script setup>
import { ref } from 'vue';
import axios from 'axios'
import { useRouter } from 'vue-router';

const router =new useRouter();
const data=ref([])

const getdata = async () => {
  const resp = await axios.get("/api/room/list");
  console.log(resp);
  data.value = resp.data.data.list;
  console.log(data.value);
};
const toget=(v)=>{
    router.push({
      path: '/detail/'+v.id,
      query:v
    })
}
getdata();
</script>

<style lang="scss" scoped>

</style>